{% extends "two_column_body.html" %}
{% import "macros.html" as macros %}
<!-- template feedback.html -->
{% block title %}{% spaceless %}{% trans %}Feedback{% endtrans %}{% endspaceless %}{% endblock %}
{% block content %}
<h1 class="section-title">{% trans %}Give us your feedback!{% endtrans %}</h1>
{% if form.errors %}
<span class="error">
  {{form.errors.__all__}}
</span>
{%endif%}
<form method="post" action="{% url feedback %}" accept-charset="utf-8">{% csrf_token %}
    <div class="message">{{ settings.FEEDBACK_PAGE_MESSAGE|sub_vars(user)|convert_markdown }}</div>
    {% if user.is_anonymous() %}
        <div class="form-row"><label>{{form.name.label}}</label><br/>{{form.name}}</div>
        <div class="form-row">
            <label>{{form.email.label}} 
                {% if form.errors.email %}
                    <span class='error'>{% trans %}(to hear from us please enter a valid email or check the box below){% endtrans %}</span>
                {% endif %}
            </label><br/>{{form.email}}
        </div>
        <div class="form-row">
        <label>{{form.no_email.label}}
        {% if form.errors.no_email %}
        <span class="error">{% trans %}(this field is required){% endtrans %}</span>
        {% endif %}
        {{form.no_email}}
        </label>
        </div>
    {% endif %}
    <div class="form-row">
        <label>{{form.message.label}}
        {% if form.errors.message %}
        <span class="error">{% trans %}(this field is required){% endtrans %}</span>
        </label>
        {% endif %}
        <br/>
        {{form.message}}
    </div>
    {% if form.recaptcha %}
    <div class="form-row">
        {{ macros.form_field_with_errors(form.recaptcha) }}
    </div>
    {% endif %}
    {{form.next}}
    <div class="submit-row">
        <input type="submit" value="{% trans %}Send Feedback{% endtrans %}"/>&nbsp;
        <input type="submit" class="cancel" name="cancel" value="{% trans %}Cancel{% endtrans %}"/>
    </div>
</form>
{% endblock %}
<!-- end template feedback.html -->
